<?php
function theme_widget_comment($setting,&$smarty){
	if($system->theme){
        $theme_dir = kernel::get_themes_host_url().'/'.$smarty->theme;
    }else{
        $theme_dir = kernel::get_themes_host_url().'/'.app::get('site')->getConf('current_theme');
    }	
	$_return['theme_dir']=$theme_dir;
    $data = b2c_widgets::load('Comment')->getTopComment($setting['limit']);//通过数据接口取数据
    $imageDefault = app::get('image')->getConf('image.set');
    foreach($data as $k=>$v){
      if(!$v['goodsPic']){
       $data[$k]['goodsPic'] = $imageDefault['M']['default_image'];
      }
    }
	$_return['comment'] =$data;
		
	//print_r($_return);exit;
    return $_return;
}
?>